package com.shouxin.attendance.database.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.shouxin.attendance.database.model.Baby;
import com.shouxin.attendance.database.model.BabyCustody;
import com.shouxin.attendance.database.model.Clazz;
import com.shouxin.attendance.database.model.Custody;
import com.shouxin.attendance.database.model.PushData;
import com.shouxin.attendance.database.model.SwipeCardHistory;

import com.shouxin.attendance.database.dao.BabyDao;
import com.shouxin.attendance.database.dao.BabyCustodyDao;
import com.shouxin.attendance.database.dao.ClazzDao;
import com.shouxin.attendance.database.dao.CustodyDao;
import com.shouxin.attendance.database.dao.PushDataDao;
import com.shouxin.attendance.database.dao.SwipeCardHistoryDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig babyDaoConfig;
    private final DaoConfig babyCustodyDaoConfig;
    private final DaoConfig clazzDaoConfig;
    private final DaoConfig custodyDaoConfig;
    private final DaoConfig pushDataDaoConfig;
    private final DaoConfig swipeCardHistoryDaoConfig;

    private final BabyDao babyDao;
    private final BabyCustodyDao babyCustodyDao;
    private final ClazzDao clazzDao;
    private final CustodyDao custodyDao;
    private final PushDataDao pushDataDao;
    private final SwipeCardHistoryDao swipeCardHistoryDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        babyDaoConfig = daoConfigMap.get(BabyDao.class).clone();
        babyDaoConfig.initIdentityScope(type);

        babyCustodyDaoConfig = daoConfigMap.get(BabyCustodyDao.class).clone();
        babyCustodyDaoConfig.initIdentityScope(type);

        clazzDaoConfig = daoConfigMap.get(ClazzDao.class).clone();
        clazzDaoConfig.initIdentityScope(type);

        custodyDaoConfig = daoConfigMap.get(CustodyDao.class).clone();
        custodyDaoConfig.initIdentityScope(type);

        pushDataDaoConfig = daoConfigMap.get(PushDataDao.class).clone();
        pushDataDaoConfig.initIdentityScope(type);

        swipeCardHistoryDaoConfig = daoConfigMap.get(SwipeCardHistoryDao.class).clone();
        swipeCardHistoryDaoConfig.initIdentityScope(type);

        babyDao = new BabyDao(babyDaoConfig, this);
        babyCustodyDao = new BabyCustodyDao(babyCustodyDaoConfig, this);
        clazzDao = new ClazzDao(clazzDaoConfig, this);
        custodyDao = new CustodyDao(custodyDaoConfig, this);
        pushDataDao = new PushDataDao(pushDataDaoConfig, this);
        swipeCardHistoryDao = new SwipeCardHistoryDao(swipeCardHistoryDaoConfig, this);

        registerDao(Baby.class, babyDao);
        registerDao(BabyCustody.class, babyCustodyDao);
        registerDao(Clazz.class, clazzDao);
        registerDao(Custody.class, custodyDao);
        registerDao(PushData.class, pushDataDao);
        registerDao(SwipeCardHistory.class, swipeCardHistoryDao);
    }
    
    public void clear() {
        babyDaoConfig.clearIdentityScope();
        babyCustodyDaoConfig.clearIdentityScope();
        clazzDaoConfig.clearIdentityScope();
        custodyDaoConfig.clearIdentityScope();
        pushDataDaoConfig.clearIdentityScope();
        swipeCardHistoryDaoConfig.clearIdentityScope();
    }

    public BabyDao getBabyDao() {
        return babyDao;
    }

    public BabyCustodyDao getBabyCustodyDao() {
        return babyCustodyDao;
    }

    public ClazzDao getClazzDao() {
        return clazzDao;
    }

    public CustodyDao getCustodyDao() {
        return custodyDao;
    }

    public PushDataDao getPushDataDao() {
        return pushDataDao;
    }

    public SwipeCardHistoryDao getSwipeCardHistoryDao() {
        return swipeCardHistoryDao;
    }

}
